﻿using IceDog.DNF.Program.Mvc5.Models;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace IceDog.DNF.Program.Mvc5.EfContext
{
    public class AccountContext : DbContext
    {
        public DbSet<SystemRole> SystemRoles { get; set; }
        public DbSet<SystemUser> SystemUsers { get; set; }
        public DbSet<SystemUserRole> SystemUserRoles { get; set; }

        public AccountContext() : base("AccountContext")
        {

        }
        
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //去掉表名复数显示，即不是SystemUsers，而是SystemUser
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}